function profileActionMenu(source, callback){
	if($("#pagina").length != 0){
		$("#pagina").fadeOut("slow", function(){
			$("#pagina").remove();
			
			loadActionView(source, callback);
		});
	}
	else{
		loadActionView(source, callback);
	};
}

function loadActionView(source, callback){
	var innerContent = $("<div />", {
		id : "pagina",
	});
	
	innerContent.addClass("innerContent");
	innerContent.css("z-index", "198");
	innerContent.css("display", "none");
	innerContent.appendTo("#profile-data");
	
	innerContent.load(source, function(){
		innerContent.fadeIn("slow");
		callback.call(innerContent);
	});
}


$(document).ready(function() {
	if($("#content").length == 0){
		return;
	}
	
	$.get("/dotcao/ws/users/loggedin", function(data){
		if(data.firstname){
			$("#profile-menu #username").html(data.firstname + " " + data.lastname);
		}
	}, "json");
	
	$("#change-profile-picture").bind("click", function(){
		window.location = "upload/profile.html";
		return false;
	});

	$("#back-to-wall").bind("click", function(){
		window.location = "wall.html";
		return false;
	});
	
//	$("#wall-my-animals-command").bind("click", function(){
//		wallActionMenu("show-animals.html .form-content", function(){
//			loadUserAnimals("#pagina .form-content");											
//		});
//	});

});